namespace SimplePersonApp.Migrations
{
    using SimplePersonApp.Models;
    using System;
    using System.Data.Entity;
    using System.Data.Entity.Migrations;
    using System.Linq;

    internal sealed class Configuration : DbMigrationsConfiguration<SimplePersonApp.Models.PeopleDbContext>
    {
        public Configuration()
        {
            AutomaticMigrationsEnabled = false;
        }

        protected override void Seed(SimplePersonApp.Models.PeopleDbContext context)
        {
            //Seeding New Person
            Person test1 = new Person { FirstName = "Tre", LastName = " Davis", BirthDate = "April 26th, 1991"};
            Person test3 = new Person { FirstName = "Trey", LastName = " Davis", BirthDate = "April 26th, 1991"};
            Person test2 = new Person { FirstName = "Donny", LastName = "Walters", BirthDate = "Jan 21, 2004"  };

            context.Person.AddOrUpdate(n => n.FirstName,
               test1,test2,test3);
        }
            //  This method will be called after migrating to the latest version.

            //  You can use the DbSet<T>.AddOrUpdate() helper extension method 
            //  to avoid creating duplicate seed data. E.g.
            //
            //    context.People.AddOrUpdate(
            //      p => p.FullName,
            //      new Person { FullName = "Andrew Peters" },
            //      new Person { FullName = "Brice Lambson" },
            //      new Person { FullName = "Rowan Miller" }
            //    );
            //
    }
}
